/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package server.domain;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 *
 * @author fillipe
 */
public class OrderItem implements Serializable{

    private PKOrderItem id;
    private Integer quantity;
    private BigDecimal unitPrice;
    private BigDecimal totalItem;
    private BigDecimal discount;

    public OrderItem() {
    }

    public OrderItem(PKOrderItem id, Integer quantity, BigDecimal unitPrice, BigDecimal totalItem, BigDecimal discount) {
        this.id = id;
        this.quantity = quantity;
        this.unitPrice = unitPrice;
        this.totalItem = totalItem;
        this.discount = discount;
    }

    public PKOrderItem getId() {
        return id;
    }

    public void setId(PKOrderItem id) {
        this.id = id;
    }

    public BigDecimal getDiscount() {
        return discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public BigDecimal getTotalItem() {
        return totalItem;
    }

    public void setTotalItem(BigDecimal totalItem) {
        this.totalItem = totalItem;
    }

    public BigDecimal getUnitPrice() {
        return unitPrice;
    }

    public void setUnitPrice(BigDecimal unitPrice) {
        this.unitPrice = unitPrice;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final OrderItem other = (OrderItem) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 97 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }
}
